package cn.rongdao.jrkabao.model.financing;

import com.mifengkong.frtools.http.request.HttpFunction;
import com.mifengkong.frtools.util.FRString;

import cn.rongdao.jrkabao.bean.financing.FinancingBean;
import cn.rongdao.jrkabao.model.api.BaseKaMaoModel;
import io.reactivex.Observable;
import io.reactivex.Observer;

/**
 * Created by jack on 2017/9/12
 */

public class FinancingModel extends BaseKaMaoModel {

    public static FinancingModel getInstance() {
        return getPresent(FinancingModel.class);
    }

    public void execute(String page, String page_size, Observer<FinancingBean> observer) {
        addParamStrings("page", FRString.valueOf(page));
        addParamStrings("page_size", FRString.valueOf(page_size));
        Observable<FinancingBean> observable = mServletApi.getFinancialByPage(mParams).map(new HttpFunction<FinancingBean>());
        toSubscribe(observable, observer);
    }
}